<template>
  <div class="public-form">
    <div class="public-header">
      <div class="addmemo">
        <el-input
          placeholder="请输入角色名称"
          v-model="adminName"
          class="input-with-select"
        >
          <el-button
            slot="append"
            icon="el-icon-search"
            class="search"
            @click="searchData"
          ></el-button>
        </el-input>
        <el-button
          type="success"
          icon="el-icon-plus"
          class="add-btn"
          size="medium"
          @click="addData"
          >增加</el-button
        >
      </div>
    </div>
    <el-table
      :data="rowData"
      style="width: 100%"
      row-key="id"
      :row-style="{ height: '48px' }"
    >
      <el-table-column
        :prop="item.name"
        v-for="(item, index) in clumnData"
        :key="index"
        :label="item.lable"
        :min-width="item.width"
      ></el-table-column>
      <subTableItem_one></subTableItem_one>

      <el-table-column label="操作" min-width="200px">
        <template slot-scope="scope">
          <el-button
            type="primary"
            size="mini"
            icon="el-icon-edit"
            @click="selectData(scope.row)"
            >修改</el-button
          >
          <el-button
            type="danger"
            size="mini"
            icon="el-icon-delete"
            @click="removeData(scope.row)"
            >删除</el-button
          >
        </template>
      </el-table-column>
    </el-table>
    <div class="footer-page">
      <div>
        <span
          >共 <strong>{{ this.countNum }}</strong> 条</span
        >
        |
        <span
          >每页 <strong>20</strong> 条 |
          <span
            >共 <strong>{{ this.maxPage }}</strong> 页</span
          ></span
        >
      </div>
      <el-pagination
        background
        :total="countNum"
        :current-page.sync="nowPage"
        layout="prev, pager, next, jumper"
        @current-change="changePage"
      >
      </el-pagination>
    </div>
  </div>
</template>
<script>
import { mixins } from "../../mixin/page";
import subTableItem_one from "../../components/components_wxq/subTableItem_one.vue";
export default {
  name: "activituFrom",
  mixins: [mixins],
  components: {
    subTableItem_one,
  },
  props: {
    clumnData: Array,
    rowData: Array,
  },

  data() {
    return {
      adminName: "",
    };
  },
  methods: {
    searchData() {
      this.$emit("searchData", this.adminName);
    },
    selectData(obj) {
      this.$emit("selectData", obj);
    },
    removeData(obj) {
      this.$emit("removeData", obj);
    },
    addData() {
      this.$emit("addData");
    },
    changePage(num) {
      console.log(num);
      this.$emit("changePage", num);
    },
  },
  computed: {},
  watch: {},
};
</script>
<style lang="less" scoped>
.public-form {
  padding: 20px 30px;
  background-color: #ffffff;
  border-top: 4px solid #4091ff;
  border-bottom: 2px solid #ccc;
  border-radius: 8px 8px 0 0;
}
.public-header {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  //   padding: 0 32px;
  box-sizing: border-box;
}
.addmemo {
  display: flex;
  width: 100%;
  justify-content: space-between;

  .el-input {
    width: 40%;
    margin-right: 32px;
  }
  .el-input /deep/ .el-input__inner {
    &:focus {
      border: 1px solid #4091ff;
    }
  }
  .search {
    background-color: #4091ff;
    color: #fff;
    border-radius: 0 4px 4px 0;
    border: 1px solid #4091ff;
  }
  .add-btn {
    padding: 0 12px !important;
    height: 36px;
  }
}
.el-table {
  .el-button {
    padding: 6px 8px;
  }
}
.el-pagination {
  display: flex;
  justify-content: flex-end;
}
.footer-page {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  span {
    font-size: 12px;
    strong {
      font-size: 14px;
    }
  }
}
// .el-tag {
//   font-size: 12px !important;
//   line-height: 20px;
//   padding: 0 6px;
//   text-align: center;
//   height: 20px;
//   border: none;
//   color: #fff;
// }

.tag-s {
  background-color: #f2b612;
}
.tag-o {
  background-color: #41b6e6;
}
</style>
